<?php
/** 
 * 配置信息控制器
 * @DateTime 2017-08-25
 * @author xyl
 */
class Config extends Admin_Controller{

	function __construct(){
		parent::__construct();
		// $class=$this->router->class;
		// $result = $this->auth_check($class);
		$this->load->model('Config_model','configs');
	}

	/**
	 * 配置信息展示
	 * @DateTime 2017-08-25
	 * @author xyl
	 * @return   [type]     [description]
	 */
	function index()
	{
		// if (!$this->authcheck('admin','select')) {
		// 	$this->error('您无权限访问该模块');
		// 	return;
		// }
		if($_POST){
			$post = $this->input->post();
			$res = $this->configs->updateConfig($post);
			$this->handleResult($res);
		}else{
			$vdata = array();
			$info = $this->configs->getConfigDetail();
			if(!empty($info)){
				$vdata['info'] = $info;
			}
			$this->load->view('Config/config',$vdata);
		}
		
	}

}